﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using System.IO;

namespace GT.Xna.Windows
{
    public static partial class GameExtensions
    {
        public static Texture2D GetTexture(this byte[] data)
        {
            Texture2D ret = null;
            using (MemoryStream ms = new MemoryStream(data))
            {
                ms.Seek(0, SeekOrigin.Begin);
                ret = Texture2D.FromStream(GameGlobals.Game.GraphicsDevice, ms);
            }
            return ret;
        }
    }
}
